package com.xielx.mynovel.tab;


import java.util.ArrayList;
import java.util.List;

public abstract class BottomTab {
    private int image;
    private int image2;
    private int text;
    private static List<BottomTab> repo;

    public BottomTab(int image,int image2, int text) {
        this.image = image;
        this.image2 = image2;
        this.text = text;
    }

    protected abstract void onClick();

    public abstract boolean disable();

    public void click() {

    }

    public static List<BottomTab> getInstances(Class<? extends BottomTab>... tabs) {
        if (null != repo) {
            return repo;
        }
        try {
            repo = new ArrayList<>();
            for (Class<? extends BottomTab> tab : tabs) {
                BottomTab temp = tab.newInstance();
                repo.add(temp);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return repo;
    }

    public int getImage() {
        return image;
    }

    public int getText() {
        return text;
    }

    public int getImage2() {
        return image2;
    }
}
